﻿using System;
using System.Collections;
using System.Reflection;
using log4net;
using log4net.Config;
using System.Xml.Serialization;
using System.IO;
using System.Xml;
using System.ServiceModel;
using System.ComponentModel;
using System.ServiceModel.Security;
using System.Collections.Generic;
using System.ServiceModel.Description;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

namespace HaiFang
{
    [Serializable]
    public class ProxyUserGroup
    {
        private static string PROCEDURE_QueryUserGroup = "QueryUserGroup";

        public static IList<UserGroup> QueryUserGroup()
        {
            IList<UserGroup> list = new List<UserGroup>();
            try
            {
                using (SqlHelper helper = new SqlHelper())
                {
                    #region 构造参数
                    string comandText = PROCEDURE_QueryUserGroup;
                    #endregion

                    #region 获取执行结果
                    DataTable dt = helper.ExecuteDataTable(comandText, CommandType.StoredProcedure, null);
                    list = helper.GetObjects<UserGroup>(dt);
                    #endregion
                }
            }
            catch (Exception ex)
            {
                LogHelper.Writelog(LogType.LogType_Error, ex.Message, ex);
            }
            return list;
        }
    }

    [Serializable]
    public class UserGroup
    {
        public int AutoID { get; set; }
        public string GUID { get; set; }
        public string GroupName { get; set; }
        public DateTime CreateTime { get; set; }
        public string Description { get; set; }
    }
}
